﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SocialKit.SinaWeibo.Api
{
    /// <summary>
    /// 表示新浪微博接口层异常。
    /// </summary>
    [Serializable]
    public class SinaWeiboException : Exception
    {
        /// <summary>
        /// 获取请求的API地址。
        /// </summary>
        public string RequestPath { get; private set; }

        /// <summary>
        /// 获取异常编码。
        /// </summary>
        public int ErrorCode { get; private set; }

        /// <summary>
        /// 创建一个 SocialKit.SinaWeibo.Api.SinaWeiboException 的实例。
        /// </summary>
        /// <param name="requestPath">请求的API地址。</param>
        /// <param name="errorCode">异常编码。</param>
        /// <param name="message">异常的描述信息。</param>
        public SinaWeiboException(string requestPath, int errorCode, string message)
            : base(message)
        {
            this.RequestPath = requestPath;
            this.ErrorCode = errorCode;
        }
    }
}